package com.ocom.payconfig.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ocom.common.entity.card.EntityXfRepairpayConfig;
import com.ocom.mysql.aspect.DataSourceAspect;
import com.ocom.payconfig.dao.IDaoXfRepairpayConfig;
import com.ocom.payconfig.service.XfRepairpayConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

@Service
public class XfRepairpayConfigServiceImpl extends ServiceImpl<IDaoXfRepairpayConfig, EntityXfRepairpayConfig> implements XfRepairpayConfigService {

    @Autowired
    private IDaoXfRepairpayConfig iDaoXfRepairpayConfig;

    @Override
    @DataSourceAspect
    public EntityXfRepairpayConfig getByComId(Long comId) {
        return this.getById(comId);
    }

    @Override
    @DataSourceAspect
    public List<EntityXfRepairpayConfig> getListByStatus(Integer status) {
        QueryWrapper<EntityXfRepairpayConfig> queryWrapper = Wrappers.query();
        queryWrapper.eq("status", status);
        return this.list(queryWrapper);
    }

    @Override
    @DataSourceAspect
    public boolean removeById(Serializable id) {
        return super.removeById(id);
    }

    @Override
    @DataSourceAspect
    public boolean save(EntityXfRepairpayConfig entity) {
        return super.save(entity);
    }
}
